using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using Yoozoo.UI;
public class YTextBinderTreeItem : BindingBinderTreeItemBase
{
    public static Dictionary<YTextBinder.AttributeType, LinkerValueState> AttributeValueDic = new Dictionary<YTextBinder.AttributeType, LinkerValueState>
    {
        {YTextBinder.AttributeType.m_LetterSpacing, LinkerValueState.Single},
        {YTextBinder.AttributeType.text, LinkerValueState.String},
        {YTextBinder.AttributeType.letterSpacing, LinkerValueState.Single},
        {YTextBinder.AttributeType.numberMode, LinkerValueState.Boolean},
        {YTextBinder.AttributeType.duration, LinkerValueState.Single},
        {YTextBinder.AttributeType.onTweenComplete, LinkerValueState.UnityEvent2},
        {YTextBinder.AttributeType.number, LinkerValueState.Single},
        {YTextBinder.AttributeType.supportRichText, LinkerValueState.Boolean},
        {YTextBinder.AttributeType.resizeTextForBestFit, LinkerValueState.Boolean},
        {YTextBinder.AttributeType.resizeTextMinSize, LinkerValueState.Int32},
        {YTextBinder.AttributeType.resizeTextMaxSize, LinkerValueState.Int32},
        {YTextBinder.AttributeType.alignByGeometry, LinkerValueState.Boolean},
        {YTextBinder.AttributeType.fontSize, LinkerValueState.Int32},
        {YTextBinder.AttributeType.lineSpacing, LinkerValueState.Single},
        {YTextBinder.AttributeType.onCullStateChanged, LinkerValueState.UnityEventBoolean},
        {YTextBinder.AttributeType.maskable, LinkerValueState.Boolean},
        {YTextBinder.AttributeType.isMaskingGraphic, LinkerValueState.Boolean},
        {YTextBinder.AttributeType.color, LinkerValueState.Color},
        {YTextBinder.AttributeType.raycastTarget, LinkerValueState.Boolean},
        {YTextBinder.AttributeType.enabled, LinkerValueState.Boolean},
    };
    public YTextBinderTreeItem() : base(typeof(YTextBinder))
    {
    }
    
    public override void RebuildTree()
    {
        base.RebuildTree();
        foreach (YTextBinder.AttributeType binderType in Enum.GetValues(typeof(YTextBinder.AttributeType)))
        {
            BindingLinkerTreeItem linkerTreeItem = new BindingLinkerTreeItem(binderType.ToString(), binderType.ToString(), (int)AttributeValueDic[binderType]);
            AddChild(linkerTreeItem);
        }
    }
}